/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import Mock from 'mockjs';
const { mock } = Mock;
import { responseSuccess } from '../utils';

export default {
  'POST /Inn/InnSmsListJson': (req: Request, res: Response) => {
    res.json(
      mock({
        code: '0',
        msg: '请求成功',
        data: {
          'total|50-100': 50,
          'list|5-20': [
            {
              id: '@id',
              cm_id: /\d{9}$/,
              phone: /1[3-9]\d{9}$/,
              inn_name: '@cname',
              'notice_percentage|0-100': 0,
              'only_sms_auth|1': ['1', '0'],
              create_time: '@datetime',
              update_time: '@datetime',
              'seven_notice_percentage|0-100': 0,
              'balance|0-100': 0,
              'upload_cnt|0-100': 0,
              'notice_cnt|0-100': 0,
              'seven_upload_cnt|0-100': 0,
              create_date: '@date',
              'is_recorded|1': ['1', '0'],
              'storage_auth|1': ['1', '0'],
            },
          ],
        },
      }),
    );
  },
  'POST /Inn/innSmsdetail': (req: Request, res: Response) => {
    res.json(
      mock({
        code: '0',
        msg: '请求成功',
        'data|5-20': [
          {
            'percent|0-100': 0,
            'cnt|0-100': 0,
            date: '@date',
          },
        ],
      }),
    );
  },
  'POST /Inn/complaintDetail': (req: Request, res: Response) => {
    res.json(
      mock({
        code: '0',
        msg: '请求成功',
        data: {
          'total|50-100': 50,
          'list|15': [
            {
              complaint_time: '@datetime',
              brand_cn: '中通',
              waybill: '@id',
              complaint_reason: '@csentence(7,10)',
            },
          ],
        },
      }),
    );
  },

  'POST /Inn/complaintList': (req: Request, res: Response) => {
    res.json(
      mock({
        code: '0',
        msg: '请求成功',

        data: {
          'total|50-100': 50,
          'list|5-20': [
            {
              id: '@id',
              month: '@date',
              cm_id: /\d{9}$/,
              inn_name: '@cname',
              phone: /1[3-9]\d{9}$/,
              league_name: '@cname',
              'notice_percentage|1-100': 1,
              'storage_num|1-100': 1,
              'complaint_num|1-100': 1,
              'complaint_percent|1-100': 1,
              'complaint_total_num|1-100': 1,
              'only_sms_auth|1': ['1', '0'],
              'storage_auth|1': ['1', '0'],
            },
          ],
        },
      }),
    );
  },

  'POST /Inn/innSmsStatus': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/sendSms': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/upload': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /Inn/getExcel': (req: Request, res: Response) => responseSuccess(req, res),
};
